﻿using DFGK_WMS.Model.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DFGK_WMS.Model.Dto.YS
{
    public class ReceivingBillAndPackage
    {
        /// <summary>
        /// 单号
        /// </summary>
        [MaxLength(60)]
        public string BillNo { get; set; }
        public string OtherTypeCode { get; set; }
        public bool? IsNeedQc { get; set; }
        public string? WorkShopName { get; set; }
        public string? WorkShopCode { get; set; }
        public string BatchNo { get; set; }
        public int? BillType { get; set; }
        /// <summary>
        /// 供应商Id
        /// </summary>
        public long? SupplierId { get; set; }
        /// <summary>
        /// 供应商名称
        /// </summary>
        [MaxLength(20)]
        public string SupplierName { get; set; }
        /// <summary>
        /// 采购模式
        /// </summary>
        public string POMode { get; set; }


        public string StockCode { get; set; }
        public string StockName { get; set; }
        /// <summary>
        /// 客户id
        /// </summary>
        public long? CustomerId { get; set; }

        /// <summary>
        /// 客户名称
        /// </summary>
        [MaxLength(20)]
        public string CustomerName { get; set; }

        /// <summary>
        /// 状态：0-未开始；1-未完成；2-已完成
        /// </summary>
        public int Status { get; set; }

        /// <summary>
        /// 库存地点
        /// </summary>
        [MaxLength(20)]
        public string StoLocation { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime? BeginDate { get; set; }
        /// <summary>
        /// 完成时间
        /// </summary>
        public DateTime? EndDate { get; set; }
        /// <summary>
        /// 关联单号
        /// </summary>
        public string RefSn { get; set; }
        /// <summary>
        /// 收货人
        /// </summary>
        public string Receiver { get; set; }

        /// <summary>
        /// 总数量
        /// </summary>
        [Column(TypeName = "decimal(18,4)")]
        public decimal? TotalQty { get; set; }
        /// <summary>
        /// 总检查数量
        /// </summary>
        [Column(TypeName = "decimal(18,4)")]
        public decimal? TotalCheckQty { get; set; }
        /// <summary>
        /// 已检查数量
        /// </summary>
        [Column(TypeName = "decimal(18,4)")]
        public decimal? CheckedQty { get; set; }
        /// <summary>
        /// 是否已创建检查清单
        /// </summary>
        public bool? IsCreatedChecklist { get; set; }
        /// <summary>
        /// 检查类型
        /// </summary>
        public int? CheckType { get; set; }
        /// <summary>
        /// 检查结果
        /// </summary>
        public int? CheckResult { get; set; }
        /// <summary>
        /// 不合格原因
        /// </summary>
        public string Ngreason { get; set; }
        /// <summary>
        /// 库房Id
        /// </summary>
        public long? WarehouseId { get; set; }
        /// <summary>
        /// 库房编码
        /// </summary>
        [MaxLength(50)]
        public string WarehouseCode { get; set; }
        /// <summary>
        /// 库房名称
        /// </summary>
        [MaxLength(20)]
        public string WarehouseName { get; set; }
        /// <summary>
        /// 总计
        /// </summary>
        [Column(TypeName = "decimal(18,4)")]
        public decimal TotalPrice { get; set; }

        /// <summary>
        /// 已经收货数量
        /// </summary>
        [NotMapped]
        public decimal? ReceivedQTY { get; set; }


        public List<PackDto> packDtos { get; set; }=new List<PackDto>();
    }
    public class PackDto
    {
        public long Id { get; set; } 
        public string Name { get; set; }
        public string Code {  get; set; }
        public string PackNo { get; set; }
        public int PackQty { get; set; }

       
    }
}
